i2crepeater 2.2.0
Loading...
Searching...
No Matches
I2C Repeater Click Driver

API for configuring and manipulating I2C Repeater Click driver. More...

Topics

 I2C Repeater Registers Settings
 Settings for registers of I2C Repeater Click driver.
 I2C Repeater MikroBUS Map
 MikroBUS pin mapping of I2C Repeater Click driver.

Functions

void i2crepeater_cfg_setup (i2crepeater_cfg_t *cfg)
 I2C Repeater configuration object setup function.
err_t i2crepeater_init (i2crepeater_t *ctx, i2crepeater_cfg_t *cfg)
 I2C Repeater initialization function.
void i2crepeater_enable_device (i2crepeater_t *ctx)
 I2C Repeater enable device function.
void i2crepeater_disable_device (i2crepeater_t *ctx)
 I2C Repeater disable device function.
err_t i2crepeater_set_i2c_address (i2crepeater_t *ctx, uint8_t slave_addr)
 I2C Repeater set I2C address function.
err_t i2crepeater_i2c_write (i2crepeater_t *ctx, uint8_t *data_in, uint16_t len)
 I2C Repeater write function.
err_t i2crepeater_i2c_read (i2crepeater_t *ctx, uint8_t *data_out, uint16_t len)
 I2C Repeater read function.
err_t i2crepeater_i2c_write_then_read (i2crepeater_t *ctx, uint8_t *data_in, uint16_t in_len, uint8_t *data_out, uint8_t out_len)
 I2C Repeater write then read function.
err_t i2crepeater_i2c_write_reg (i2crepeater_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 I2C Repeater write register function.
err_t i2crepeater_i2c_read_reg (i2crepeater_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 I2C Repeater read register function.

Detailed Description

API for configuring and manipulating I2C Repeater Click driver.

Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.

Function Documentation

◆ i2crepeater_cfg_setup()

void i2crepeater_cfg_setup ( i2crepeater_cfg_t * cfg)

I2C Repeater configuration object setup function.

This function initializes Click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See i2crepeater_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ i2crepeater_disable_device()

void i2crepeater_disable_device ( i2crepeater_t * ctx)

I2C Repeater disable device function.

This function disables the device by setting the EN pin to low logic state.

Parameters
[in]ctx: Click context object. See i2crepeater_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ i2crepeater_enable_device()

void i2crepeater_enable_device ( i2crepeater_t * ctx)

I2C Repeater enable device function.

This function enables the device by setting the EN pin to high logic state.

Parameters
[in]ctx: Click context object. See i2crepeater_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ i2crepeater_i2c_read()

err_t i2crepeater_i2c_read ( i2crepeater_t * ctx,
uint8_t * data_out,
uint16_t len )

I2C Repeater read function.

This function reads data from the I2C slave.

Parameters
[in]ctx: Click context object. See i2crepeater_t object definition for detailed explanation.
[out]data_out: Data buffer to store read data.
[in]len: Number of bytes to read.
Returns
  • 0 - Success,
  • -1 - Error.
Note
None.

◆ i2crepeater_i2c_read_reg()

err_t i2crepeater_i2c_read_reg ( i2crepeater_t * ctx,
uint8_t reg,
uint8_t * data_out,
uint8_t len )

I2C Repeater read register function.

This function reads data from a specific register of the I2C slave.

Parameters
[in]ctx: Click context object. See i2crepeater_t object definition for detailed explanation.
[in]reg: Register address.
[out]data_out: Data buffer to store read data.
[in]len: Number of bytes to read.
Returns
  • 0 - Success,
  • -1 - Error.
Note
None.

◆ i2crepeater_i2c_write()

err_t i2crepeater_i2c_write ( i2crepeater_t * ctx,
uint8_t * data_in,
uint16_t len )

I2C Repeater write function.

This function writes data to the I2C slave.

Parameters
[in]ctx: Click context object. See i2crepeater_t object definition for detailed explanation.
[in]data_in: Data buffer to be written.
[in]len: Number of bytes to write.
Returns
  • 0 - Success,
  • -1 - Error.
Note
None.

◆ i2crepeater_i2c_write_reg()

err_t i2crepeater_i2c_write_reg ( i2crepeater_t * ctx,
uint8_t reg,
uint8_t * data_in,
uint8_t len )

I2C Repeater write register function.

This function writes data to a specific register of the I2C slave.

Parameters
[in]ctx: Click context object. See i2crepeater_t object definition for detailed explanation.
[in]reg: Register address.
[in]data_in: Data buffer to be written.
[in]len: Number of bytes to write.
Returns
  • 0 - Success,
  • -1 - Error.
Note
None.

◆ i2crepeater_i2c_write_then_read()

err_t i2crepeater_i2c_write_then_read ( i2crepeater_t * ctx,
uint8_t * data_in,
uint16_t in_len,
uint8_t * data_out,
uint8_t out_len )

I2C Repeater write then read function.

This function writes data to the I2C slave, then reads the response.

Parameters
[in]ctx: Click context object. See i2crepeater_t object definition for detailed explanation.
[in]data_in: Data buffer to be written.
[in]in_len: Number of bytes to write.
[out]data_out: Data buffer to store read data.
[in]out_len: Number of bytes to read.
Returns
  • 0 - Success,
  • -1 - Error.
Note
None.

◆ i2crepeater_init()

err_t i2crepeater_init ( i2crepeater_t * ctx,
i2crepeater_cfg_t * cfg )

I2C Repeater initialization function.

This function initializes all necessary pins and peripherals used for this Click board.

Parameters
[out]ctx: Click context object. See i2crepeater_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See i2crepeater_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ i2crepeater_set_i2c_address()

err_t i2crepeater_set_i2c_address ( i2crepeater_t * ctx,
uint8_t slave_addr )

I2C Repeater set I2C address function.

This function sets the slave address for I2C communication.

Parameters
[in]ctx: Click context object. See i2crepeater_t object definition for detailed explanation.
[in]slave_addr: I2C slave address.
Returns
  • 0 - Success,
  • -1 - Error.
Note
None.